package spring;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

public class RmServiceImpl implements RmService{
	public static void main(String args[]) 
	   { 
//		 ApplicationContext context = new
//         ClassPathXmlApplicationContext("server_config.xml");
//		 //ClassPathXmlApplicationContext("RmService.xml");
//		 context.getBean("Server");
		
//         Resource  res = new ClassPathResource("server_config.xml"); 
//         BeanFactory  factory = new  XmlBeanFactory(res); 
//         System.out.println("factory created"); 
//         RmService bean1 = (RmService)factory.getBean("Server"); 
         //String s = bean1.getresult(args[0]); 
        
		 ApplicationContext context = new
         ClassPathXmlApplicationContext("server_config.xml");

		 context.getBean("Server");
		 System.out.println("server ready");
		
		 System.out.println("ready");
		 //while(true){}
	   } 
	   public RmServiceImpl() 
	   { 
	      System.out.println("constructor ok"); 
	   } 
	   public String getresult(String  a) 
	   { 
	      return "Hai"+a; 
	   }
}
